void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
  if (Serial.available() > 0) {
    String text = "";
    String textOld = text;
    while (true) {
      char text01 = Serial.read();
      text += text01;
      if (textOld == text) {
        break;
      }
      textOld = text;
    }
    Serial.println(text);
  } else {
    delay(1000);
  }
  Serial.println("结束");

}
